package com.elmcode.server.controller.app;

import com.elmcode.server.dto.PayInfoDTO;
import com.elmcode.server.service.OrderService;
import com.elmcode.server.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@Slf4j
@Api(tags = "订单接口")
@RestController
@RequestMapping("app/book")
public class OrderController {

    @Autowired
    OrderService orderService;

    @ApiOperation("创建订单接口")
    @PostMapping
    public Result createOrder(Long addressId,String remark){
        Map<String,Object> data = orderService.createOrder(addressId,remark);

        return Result.ok("订单创建成功",data);
    }

}
